package cn.exrick.xboot.modules.backlogOrFullList.dao.mapper;

import cn.exrick.xboot.modules.backlogOrFullList.entity.APPBacklogOrFullList;
import cn.exrick.xboot.modules.backlogOrFullList.sqlprovider.BackLogSqlProvider;
import cn.exrick.xboot.modules.base.entity.User;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import cn.exrick.xboot.modules.backlogOrFullList.entity.BacklogOrFullList;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.DeleteProvider;
import org.apache.ibatis.annotations.Param;

import javax.websocket.server.PathParam;
import java.util.List;
import java.util.Map;

/**
 * 待办已办列表数据处理层
 * @author Exrick
 */
public interface backlogOrFullListMapper extends BaseMapper<BacklogOrFullList> {

    /**
     * 待办已办列表的条件查询
     * @param page
     * @param backlogOrFullList
     * @return
     */
    public IPage<BacklogOrFullList> selectBacklogOrFullListPageVoMap(Page page, @Param("backlogOrFullList") BacklogOrFullList backlogOrFullList );


    /**
     * 20190821
     * njp
     * portal待办已办列表的条件查询(num控制数量)
     * map 为参数
     */
    public List<BacklogOrFullList> selectBacklogOrFullListByMap(@Param("map") Map<String,Object> map);

    /**
     * xbw
     * 根据推动的消息ID,改变消息状态
      */
    public Integer UpdateMseeageType(@Param("map") Map<Object,Object> map);

    /**
     * xbw
     * 查找消息ID
     */
   public String  selectInfoId(@Param("mapId") Map<Object,Object> mapId);

    /**
     *查询APP的待办列表
     */
    public List<APPBacklogOrFullList> selectBacklogOrFullListAPP(BacklogOrFullList backlogOrFullList);

    /**
     * APP待办已办列表的条件查询
     * @param page
     * @param backlogOrFullList
     * @return
     */
    public IPage<BacklogOrFullList> selectBacklogOrFullListPageVoMapApp(Page page, @Param("backlogOrFullList") BacklogOrFullList backlogOrFullList );
    /**
     * 查询当前用户的待办数量
     * @return
     */
    public Integer selectBacklogAngleNum( @Param("username") String username );
    /**
     * add njp 20200427
     * 通过messageId删除待办已办数据
     * @return
     */
    public void deleteBacklogByMessageID( @Param("messageId") String messageId );

    /**
     *根据用户删除待办
     * @param userId
     */
    @Delete("delete from t_backlog_or_full_list where user_code=#{userId}")
    public void deleteBacklogByUser(@Param("userId") String userId);

    /**
     * 根据users批量删除
     * @param userlist
     */
    @DeleteProvider(type = BackLogSqlProvider.class, method = "batchDelete")
    public Boolean deleteBacklogByUsers(@Param("userlist") List<User> userlist);

}